-
Notifications
You must be signed in to change notification settings - Fork 14
feat(dial-pad): add long press on '0' button to render '+' (VIV-2876) #2585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2585 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 415 415
Lines 19994 20114 +120
Branches 3378 3399 +21
==========================================
+ Hits 19994 20114 +120
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
05778ab to
bdeaa96
Compare
| const target = event.currentTarget as HTMLElement | null; | ||
|
|
||
| this._longPressTimeoutId = window.setTimeout(() => { | ||
| this._suppressNextClick = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a problem if click is not fired, then the next button click will be ignored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a code to reset suppress flag after a delay to handle cases where click doesn't fire
| return event; | ||
| } | ||
|
|
||
| it('tapping 0 adds "0"', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's follow our naming convention with 'should'
| it('tapping 0 adds "0"', async () => { | |
| it('should add "0" when tapping 0', async () => { |
| @pointerup="${(_, c) => c.parent._endLongPress()}" | ||
| @pointercancel="${(_, c) => c.parent._cancelLongPress()}" | ||
| @pointerleave="${(_, c) => c.parent._cancelLongPress()}" | ||
| @click="${onDigitClick}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about long-pressing with the keyboard? It should probably long-press with space as well
Maybe it would be easier to track the time when the pointer or keyboard press started and determine in the click handler if it was a long press. Just note that pointer/keyup is fired before click
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For 'long-press with space' it should be handled by input, but not digit buttons. I have added the implementation
cde467e to
b4a7501
Compare
b4a7501 to
60d1c3e
Compare
b0c2456 to
4b88cd7
Compare
4b88cd7 to
9571da8
Compare
9571da8 to
e9927b2
Compare
8a02315 to
fe40bd8
Compare
fe40bd8 to
2a71a24
Compare
ec75401 to
1a11888
Compare
No description provided.